import React, { Component } from 'react'
import { connect } from 'react-redux'
import * as actions from "../../store/action"
import { bindActionCreators } from 'redux'
import Title from '../../components/Title'
import Tcon from '../../components/Tcon'
export class Fenxi extends Component {
  componentDidMount() { 
    this.props.getListAction()
   }
  render() {
    console.log(this.props,"shu")
     const {list ,activeIndex} =this.props
    return (
      <div>  
        <Title></Title>
        <Tcon children={list[activeIndex] ? 
         list[activeIndex].children :[]  }></Tcon>

      </div>
    )
  }
}

const mapStateToProps = (state) => ({
  ...state.reducer
})

const mapDispatchToProps =(dispatch)=>{
  return bindActionCreators(actions,dispatch)
}

export default connect(mapStateToProps, mapDispatchToProps)(Fenxi)